import java.util.Arrays;
public class Test {
    public static void main(String[] args) {
        import java.util.Scanner;
        public class Main {
            public static void main(String[] args) {
                Scanner scanner = new Scanner(System.in);
                int a = scanner.nextInt();
                int b = scanner.nextInt();
                if(a>b)
                {
                    System.out.print(a+b+" ");
                    System.out.print(a-b+" ");
                    System.out.print(a*b+" ");
                    System.out.print(a/b+" ");
                    System.out.print(a%b+" ");
                }
                else
                {
                    System.out.print(a+b+" ");
                    System.out.print(b-a+" ");
                    System.out.print(a*b+" ");
                    System.out.print(b/a+" ");
                    System.out.print(b%a+" ");
                }
                scanner.close();
            }
        }
    }
    public static void main7(String[] args) {
        int [][]array={{1,2,3,4,5},{6,7,8,9,10}};
        for (int i = 0; i < array.length ; i++) {
            for (int j = 0; j <array[i].length ; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println("");
        }
        System.out.println(array.length);
        System.out.println(array[0].length);
        System.out.println(array[1].length);
        System.out.println(Arrays.toString(array[0]));
        System.out.println(Arrays.toString(array[1]));
        System.out.println(Arrays.deepToString(array));

    }
    public static void main6(String[] args) {
        int [][]array={{1,2,3,4,5},{6,7,8,9,10}};
        for (int i = 0; i < array.length ; i++) {
            for (int j = 0; j <array[i].length ; j++) {
                System.out.printf("%d ",array[i][j]);
            }
            System.out.println("");
        }
    }
    public static void main5(String[] args) {
        int []array=new int[10];
        Arrays.fill(array,-1);
        System.out.println(Arrays.toString(array));
        Arrays.fill(array,0,5,1);
        System.out.println(Arrays.toString(array));
    }
    public static void main4(String[] args) {
        int []array1={1,2,3,4,5};
        int []array2={6,7,8,9,10};
        boolean flag =Arrays.equals(array1,array2);
        System.out.println(flag);
    }
    public static void main3(String[] args) {
        int []array={2,4,1,23,5,7,4,3};
        System.out.println(Arrays.binarySearch(array,23));
    }
    public static void main2(String[] args) {
        int [] array={1,2,3,4,5};
        int [] copy1=Arrays.copyOf(array,array.length*2);
        int [] copy2=Arrays.copyOf(array,array.length);
        int [] copy3=Arrays.copyOfRange(array,0,3);
        int [] copy4=new int[array.length];
        System.arraycopy(array,0,copy4,0,array.length);
        System.out.println(Arrays.toString(copy1));
        System.out.println(Arrays.toString(copy2));
        System.out.println(Arrays.toString(copy3));
        System.out.println(Arrays.toString(copy4));
    }
    public static void main1(String[] args) {
        int []array={1,2,3,4,5};
        System.out.println(Arrays.toString(array));
    }
}
